<template>
  <button @click="isShow = !isShow">点击直接修改</button>
  <button @click="btn">点击调用函数修改</button>
  <div class="box" v-show="isShow">盒子</div>
</template>

<script>
  import { ref } from "vue";
  export default {
    name: "App",
    setup() {
      const isShow = ref(true);
      const btn = () => {
        isShow.value = !isShow.value
      };
      return { isShow, btn };
    },
  };
</script>

<style scoped>
.box {
  width: 100px;
  height: 100px;
  background-color: pink;
}
</style>